//
//  AlterView.m
//  代理端
//
//  Created by mac on 16/3/4.
//  Copyright © 2016年 sliver. All rights reserved.
//

#import "AlterView.h"
//#import "SelectButen.h"

@interface AlterView ()

@property (weak, nonatomic) IBOutlet UIView *backView;
@property (weak, nonatomic) IBOutlet UIButton *makersureclic;
@property (weak, nonatomic) IBOutlet UIButton *dissbtnclic;

@property (weak, nonatomic) IBOutlet UILabel *messageLable;
@end
@implementation AlterView

-(void)awakeFromNib
{
    self.backView.backgroundColor = [UIColor clearColor];
    
    self.backView.layer.masksToBounds = YES;
    
    self.backView.layer.cornerRadius = 5;
    
}

-(void)setwitchbtnCount:(NSInteger )count
{
    if (count ==1) {
        CGRect fram = self.makersureclic.frame;
        fram.size.width = self.backView.frame.size.width;
        self.makersureclic.frame = fram;
        self.dissbtnclic.hidden = YES;
    }else
    {
        CGRect fram = self.makersureclic.frame;
        self.makersureclic.frame = fram;
        fram.size.width = self.backView.frame.size.width/2;
        self.dissbtnclic.hidden = NO;

    }
}
//取消按钮
- (IBAction)dissAlter:(UIButton *)sender {
    
    
    if ([self.deleget respondsToSelector:@selector(WitchBtnClic:WithMessae:)]) {
        
        [self.deleget WitchBtnClic:sender WithMessae:self.messageLable.text];
        
    }
    
}
-(void)setMessage:(NSString *)str
{
    self.messageLable.text = str;
}
-(void)changetitle:(NSString *)left righttitle:(NSString *)right
{
    [self.makersureclic setTitle:left forState:UIControlStateNormal];
    [self.dissbtnclic setTitle:right forState:UIControlStateNormal];

}
@end
